<template>
	<div id="app">
		<button type="button" @click="openlayer" >打开弹框</button>
		<tankuang v-if="flag" :dataList="dataList" @closeBtn="close" @openBtn="open"> </tankuang>
			
	</div>
</template>

<script>
	import tankuang from './components/tankuang.vue'
	export default {
		name: 'App',
		components: {
			tankuang
		},
		data(){
			return{
				flag:false,
				dataList:{
					title:'提示',
					text:'是否将文件永久删除',
					button:[
						{
							text:'确定',
							type:'1'
						},
						{
							text:'取消',
							type:'0'
						}
					]
				}
			}
		},
		methods: {
			openlayer(){
				this.flag=true
			},
			close(type){
				if(!type){
					this.flag=false
				}
			},
			open(type){
				if(type){
					alert('删除成功')
					this.flag=false
				}
			},
		}
	}
</script>

<style>
	#app {
		font-family: Avenir, Helvetica, Arial, sans-serif;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
		text-align: center;
		color: #2c3e50;
		margin-top: 60px;
	}
</style>
